﻿
using Irony.Compiler;

namespace IronLua.Ast {

	public abstract class LuaNode : AstNode {

		public abstract LuaNodeType NodeType {
			get;
		}

		public LuaNode (CompilerContext context, NonTerminal nonTerminal, SourceLocation location, AstNodeList childNodes)
			: base (context, nonTerminal, location, childNodes)
		{
		}

		public abstract void Accept (ILuaAstVisitor visitor);

		public string ToCodeString ()
		{
			return LuaPrinter.ToCodeString (this);
		}

		public override string ToString ()
		{
			return GetType ().Name;
		}
	}
}
